import { Divider } from "@nutui/nutui-react-taro";
import { View, Text } from "@tarojs/components";
import { IconFont } from "@nutui/icons-react-taro";

interface ILoadMoreProps {
  loadStatus: API.LoadStatusProps;
}

const ILoadMoreIndex: React.FC<ILoadMoreProps> = (props) => {
  const { loadStatus } = props;

  return (
    <View className="loading_box flex_row">
      <Divider
        style={{
          color: "#d2c7c7",
          borderColor: "#d2c7c7",
          padding: "0 16px",
        }}
      >
        {loadStatus == "loading" ? (
          <>
            <IconFont name="loading" size="20px" color="#606266" />
            <Text className="loading_text">正在加载</Text>
          </>
        ) : loadStatus == "more" ? (
          <Text className="loading_text">下滑查看更多</Text>
        ) : (
          <Text className="loading_text">没有更多了</Text>
        )}
      </Divider>
    </View>
  );
};

export default ILoadMoreIndex;
